﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="salesDash.aspx.cs" Inherits="salesDash" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>Salesuser Account</title>
    <script src="JS/Plugins/1.4.2-jquery.min.js" type="text/javascript"></script>
    <link href="CSS/1.10.3-jquery-ui.css" rel="stylesheet" type="text/css" />
    <script src="JS/jquery-1.9.1.js" type="text/javascript"></script>
    <script src="JS/Plugins/jquery-1.9.1.js" type="text/javascript"></script>
    <link rel="stylesheet" href="/resources/demos/style.css" />
    <script src="JS/1.10.3-jquery-ui.js" type="text/javascript"></script>
    <link rel="stylesheet" href="css/HeaderDesign.css" type="text/css">
    <link rel="stylesheet" href="css/menu.css" type="text/css">
    <style>


.textfield{ border-top: 1px solid #c1c1c1;border-left: 1px solid #c1c1c1;border-right: 1px solid #ebebeb; border-bottom: 1px solid #ebebeb;background: #fff url(http://imgs.bharatmatrimony.com/bmimgs/inputbg.gif) no-repeat top left;   font-family:arial, verdana;  color:#666; height:19px; padding:2px 0px 0px 5px; }
.selectfield{background:url(http://imgs.bharatmatrimony.com/bmimgs/inputbg.gif) no-repeat scroll left top #FFFFFF; border-color:#C1C1C1 #EBEBEB #EBEBEB #C1C1C1;border-style:solid;border-width:1px;color:#666666;font-family:arial,verdana;font-size:12px;height:22px;padding:1px 0 2px 2px;}
.inputtext, .addtxtfield{ border-top: 1px solid #c1c1c1;border-left: 1px solid #c1c1c1;border-right: 1px solid #ebebeb; border-bottom: 1px solid #ebebeb;font-family:arial, verdana;  color:#666; padding:2px 0px 0px 5px; }
#chkradio { !important; vertical-align:center; !important;}
.radiomargin { vertical-align:middle; display:inline; float:none; margin:0px 4px 0px 3px; _margin:0px 2px 0px 1px; }
checkbox{vertical-align:middle;}
label {font-size:100%;font: bold 12px arial, verdana;margin: 0;padding: 0;text-align: left;}


html,body{
margin:0px;	
padding:0px;
background-color:white;
}

#wrapper{

margin-left:80px;
margin-right:80px;
margin-top:20px;
margin-bottom:20px;
padding:1px;
background-color:#404040;
}

#header{

height:160px;
margin-bottom:2px;
background-color:#FFFFFF;
}

#header-center{
margin-left:35%;
margin-top:-70px;

}

#navbar{

margin-top:-40px;

}

#content{
min-height:600px;
min-width:640px;
padding:5px;
background-color:#FFFFFF;
}

#footer{
text-align:center;
font-weight:bold;
color:#FFFFFF;
height:50px;
clear:both;
margin-top:2px;
padding:5px;
background-color:#404040;
}

.divrow
{
margin-top:15px;
margin-left:20px;
margin-bottom:5px;
}
.divlbl
{
float:left;
width:150px;
border-color:#404040;
border-width:1px;

}

.button {
-moz-box-shadow:inset 0px 1px 0px 0px #97c4fe;
-webkit-box-shadow:inset 0px 1px 0px 0px #97c4fe;
box-shadow:inset 0px 1px 0px 0px #97c4fe;
background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #404040), color-stop(1, #404040) );
background:-moz-linear-gradient( center top, #3d94f6 5%, #1e62d0 100% );
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#3d94f6', endColorstr='#1e62d0');
background-color:#404040;
-moz-border-radius:6px;
-webkit-border-radius:6px;
border-radius:6px;
border:1px solid #337fed;
display:inline-block;
color:#ffffff;
font-family:arial;
font-size:15px;
font-weight:bold;
padding:6px 24px;
text-decoration:none;
text-shadow:1px 1px 0px #1570cd;
}
.button:hover 
{
background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #707070), color-stop(1, #787878) );
background:-moz-linear-gradient( center top, #707070 5%, #787878 100% );
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#707070', endColorstr='#787878');
background-color:#707070;
}
.button:active 
{
position:relative;
top:1px;
}



</style>
    <script type="text/javascript">

        $(document).ready(function () {
            var param = getParameterByName('userid');
            if (param != null && param != "") {

                $('#userid').html(param);

            }
            //alert(param);
        });

        function getParameterByName(name) {
            name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
            var regexS = "[\\?&]" + name + "=([^&#]*)";
            var regex = new RegExp(regexS);
            var results = regex.exec(window.location.href);
            if (results == null)
                return "";
            else
                return decodeURIComponent(results[1].replace(/\+/g, " "));
        }

    </script>
    <script>
        function changePassword() {

            var jData = {};
            jData.Password = $('#txtNewpassword').val();
            jData.NewPassword = $('#txtConfirmpassword').val();


            $.ajax({
                type: "POST",
                url: "LoginService.svc/changeSalesuserPwd",
                data: JSON.stringify(jData),
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (response) {
                    var Result = eval('(' + response.d + ')');
                    alert(Result["Message"]);

                    window.location = "SalesUserDashboard.aspx";

                },
                failure: function (msg) {
                    alert(msg);
                },
                error: function (jqXHR, exception) {
                    if (jqXHR.status === 0) {
                        alert('Not connect.\n Verify Network.');
                    } else if (jqXHR.status == 404) {
                        alert('Requested page not found. [404]');
                    } else if (jqXHR.status == 500) {
                        alert('Internal Server Error [500].');
                    } else if (exception === 'parsererror') {
                        alert('Requested JSON parse failed.');
                    } else if (exception === 'timeout') {
                        alert('Time out error.');
                    } else if (exception === 'abort') {
                        alert('Ajax request aborted.');
                    } else {
                        alert('Uncaught Error.\n' + jqXHR.responseText);
                    }
                }

            });
            return false;
        }

    </script>
    <script>
        $(function () {
            $("#accordion").accordion({
                event: "click hoverintent"
            });
        });

        /*
        * hoverIntent | Copyright 2011 Brian Cherne
        * http://cherne.net/brian/resources/jquery.hoverIntent.html
        * modified by the jQuery UI team
        */
        $.event.special.hoverintent = {
            setup: function () {
                $(this).bind("mouseover", jQuery.event.special.hoverintent.handler);
            },
            teardown: function () {
                $(this).unbind("mouseover", jQuery.event.special.hoverintent.handler);
            },
            handler: function (event) {
                var currentX, currentY, timeout,
        args = arguments,
        target = $(event.target),
        previousX = event.pageX,
        previousY = event.pageY;

                function track(event) {
                    currentX = event.pageX;
                    currentY = event.pageY;
                };

                function clear() {
                    target
          .unbind("mousemove", track)
          .unbind("mouseout", clear);
                    clearTimeout(timeout);
                }

                function handler() {
                    var prop,
          orig = event;

                    if ((Math.abs(previousX - currentX) +
            Math.abs(previousY - currentY)) < 7) {
                        clear();

                        event = $.Event("hoverintent");
                        for (prop in orig) {
                            if (!(prop in event)) {
                                event[prop] = orig[prop];
                            }
                        }
                        // Prevent accessing the original event since the new event
                        // is fired asynchronously and the old event is no longer
                        // usable (#6028)
                        delete event.originalEvent;

                        target.trigger(event);
                    } else {
                        previousX = currentX;
                        previousY = currentY;
                        timeout = setTimeout(handler, 100);
                    }
                }

                timeout = setTimeout(handler, 100);
                target.bind({
                    mousemove: track,
                    mouseout: clear
                });
            }
        };
    </script>
    <script src="JS/jquery.validate.js" type="text/javascript"></script>
    <script src="JS/jquery.validation.functions.js" type="text/javascript"></script>
    <script src="JS/Shi-1.3.js" type="text/javascript"></script>
    <link href="CSS/jquery.validate.css" rel="stylesheet" type="text/css" />
    <link href="CSS/style33.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript">
        jQuery(function () {
            jQuery("#txtPassword").validate({
                expression: "if (VAL) return true; else return false;",
                message: "Please enter the Current Password"
            });
            jQuery("#txtNewpassword").validate({
                expression: "if (VAL.length > 5 && VAL) return true; else return false;",
                message: "Please enter a valid Password"
            });
            jQuery("#txtConfirmpassword").validate({
                expression: "if ((VAL == jQuery('#txtNewpassword').val()) && VAL) return true; else return false;",
                message: "Confirm password field doesn't match the password field"
            });
        });
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div id="wrapper">
        <div id="header">
            <img src="IMAGE/saleuser.jpg" width="100%" height="120px;" style="margin-left: 0px" />
            <!-- <div id="header-center">
<form class="form-wrapper cf" >
        <input type="text" placeholder="Search here..." required>
        <button type="submit">Search</button>
    </form>   
</div>  -->
            <div id="navbar">
                <ul id="menu">
                    <li><a href="SalesUserDashboards.aspx">Inventory</a></li>
                    <li><a href="SalesuserAccount.aspx">My Account</a></li>
                </ul>
            </div>
        </div>
        <div id="content">
            <%--<label>Logged in Salesuser:</label>   <span id="userid"></span><br /><br />--%>
            <div id="accordion" style="color: Gray">
                <%--  <h3>What to name it</h3>
  <div>
    Space for Future Enhancements...
  </div>
  <h3>What to name it</h3>
  <div>
   Space for Future Enhancements...
  </div>--%>
                <h3>
                    Change Password</h3>
                <div>
                    <div id="passBlock" style="margin-top: 20px; margin-left: 100px; width: 750px; height: auto;
                        border: 1px #D8D8D8 solid; padding: 3px; top: 15px;">
                        <div class="divrow">
                            <div class="divlbl">
                                <label id="lblname">
                                </label>
                                <label id="dob">
                                    CURRENT PASSWORD</label>
                            </div>
                            <input class="textfield" id="txtPassword" type="password" name="password" />
                        </div>
                        <div class="divrow">
                            <div class="divlbl">
                                <label for="pass" id="lblname">
                                    NEW PASSWORD</label>
                            </div>
                            <input class="textfield" type="password" id="txtNewpassword" />
                        </div>
                        <div class="divrow">
                            <div class="divlbl">
                                <label for="c_pass" id="lblname">
                                </label>
                                <label id="dob">
                                    CONFIRM PASSWORD</label>
                            </div>
                            <input class="textfield" type="password" id="txtConfirmpassword" />
                        </div>
                        <div style="">
                            <input class="button" type="submit" value="SUBMIT" style="margin-top: 20px; margin-left: 20px;
                                margin-bottom: 20px;" onclick="return changePassword();" />
                        </div>
                    </div>
                </div>
                <h3>
                    View Orders</h3>
                <div>
                    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
                        CellPadding="4" DataSourceID="SqlDataSource1" ForeColor="#333333" 
                        GridLines="None">
                        <AlternatingRowStyle BackColor="White" />
                        <Columns>
                            <asp:BoundField DataField="orderID" HeaderText="orderID" InsertVisible="False" 
                                SortExpression="orderID" />
                            <asp:BoundField DataField="orderedItems" HeaderText="orderedItems" 
                                ReadOnly="True" SortExpression="orderedItems" />
                            <asp:BoundField DataField="customerName" HeaderText="customerName" 
                                ReadOnly="True" SortExpression="customerName" />
                            <asp:BoundField DataField="customerMobile" HeaderText="customerMobile" 
                                ReadOnly="True" SortExpression="customerMobile" />
                            <asp:BoundField DataField="customerAddress" HeaderText="customerAddress" 
                                ReadOnly="True" SortExpression="customerAddress" />
                            <asp:BoundField DataField="customerCity" HeaderText="customerCity" 
                                ReadOnly="True" SortExpression="customerCity" />
                            <asp:BoundField DataField="customerState" HeaderText="customerState" 
                                ReadOnly="True" SortExpression="customerState" />
                            <asp:BoundField DataField="orderDate" HeaderText="orderDate" 
                                ReadOnly="True" SortExpression="orderDate" />
                            <asp:BoundField DataField="STATUS" HeaderText="STATUS" 
                                SortExpression="STATUS" />
                            <asp:CommandField HeaderText="STATUS" ShowEditButton="True" ShowHeader="True" />
                        </Columns>
                        <EditRowStyle BackColor="#2461BF" />
                        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                        <RowStyle BackColor="#EFF3FB" />
                        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                        <SortedAscendingCellStyle BackColor="#F5F7FB" />
                        <SortedAscendingHeaderStyle BackColor="#6D95E1" />
                        <SortedDescendingCellStyle BackColor="#E9EBEF" />
                        <SortedDescendingHeaderStyle BackColor="#4870BE" />
                    </asp:GridView>
                    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                        ConnectionString="<%$ ConnectionStrings:conString %>" 
                        SelectCommand="SELECT * FROM [MAS_torderConfirmation]"

                        UpdateCommand="MAS_porderConfirmationUpdate" UpdateCommandType ="StoredProcedure">

                        </asp:SqlDataSource>
                </div>
            </div>
        </div>
        <div id="footer">
            Copyright © Kaizen Technosoft</div>
    </div>
    </form>
</body>
</html>
